package com.mz.ozy.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.recyclerview.widget.RecyclerView;

import com.mz.ozy.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class HomeSpikeAdapter extends RecyclerView.Adapter<HomeSpikeAdapter.MyViewHolder> {


    private Context mContext;
    List<Integer> mGoodsListBeans;

    public HomeSpikeAdapter(Context context, List<Integer> mGoodsListBeans) {
        this.mContext = context;
        this.mGoodsListBeans = mGoodsListBeans;
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new MyViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_spike_list, parent, false));
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        final int bean = mGoodsListBeans.get(position);

      /*  LinearLayoutManager manager = new LinearLayoutManager(mContext);
        manager.setOrientation(LinearLayoutManager.HORIZONTAL);
        holder.mRecyclerView.setLayoutManager(manager);*/
   //     GlideUtils.loadImg(mContext, holder.hdImage, mGoodsListBeans.get(position));
    /*    holder.hdName.setText(bean.getGa_name());
        if(!TextUtils.isEmpty(bean.getGa_start_time()) && !TextUtils.isEmpty(bean.getGa_end_time())){
            holder.mHdTime.setText(bean.getGa_start_time()+"-"+bean.getGa_end_time());

        }*/
     /*   HomeSpikeChildAdapter mHomeSpikeChildAdapter = new HomeSpikeChildAdapter(mContext, bean.getGoodsList());
        holder.mRecyclerView.setAdapter(mHomeSpikeChildAdapter);
        holder.mMoreView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, MoreSpikeActivity.class);
                intent.putExtra("aid", bean.getGa_id());
                intent.putExtra("name", bean.getGa_name());

                mContext.startActivity(intent);
            }
        });*/


    }

    @Override
    public int getItemCount() {
        return mGoodsListBeans.size();
    }


    static class MyViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.hdImage)
        ImageView hdImage;
        /*@BindView(R.id.hdName)
        TextView hdName;
        @BindView(R.id.moreView)
        RelativeLayout mMoreView;
        @BindView(R.id.recyclerView)
        RecyclerView mRecyclerView;
        @BindView(R.id.hdTime)
        TextView mHdTime;*/
        public MyViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
